package cn.com.greatwall.kafka.service.dto;

import java.io.Serializable;
import java.util.Objects;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author herw
 * @Time 2021-04-16 09:07:39
 * @Version 1.0
 * @Description: TODO(用一句话描述该文件做什么)
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BrokerDto implements Serializable {
    private int bid;
    private String host;
    private int port;
    private int jmxPort;
    private long timestamp;
    private int version;

    @Override
    public int hashCode() {
        return Objects.hash(bid, host, jmxPort, port);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        BrokerDto that = (BrokerDto) o;
        return bid == that.bid && port == that.port && jmxPort == that.jmxPort
                && (host != null && host.equalsIgnoreCase(that.host));
    }
}
